<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<canvas id="myCanvas" width="600" height="380"></canvas>
<script language="javascript">
    var ctx = document.getElementById('myCanvas').getContext('2d');
    var img = new Image();
    img.onload = function(){
        ctx.drawImage(img,0,0);
        ctx.drawImage(img,30,40,140,180,0,240,140,180);
    }
    img.src = 'images/1.png';

</script>
</body>
</html> 
